/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cannes.connexion;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author p1000666
 */
public class ConnexionBDD {

    private static String url = "jdbc:oracle:thin:@iuta.univ-lyon1.fr:1521:orcl";
    private static String user = "p1000666";
    private static String passwd = "135480";
    private static Connection connect;


    /**
     * Retourne toujours la même connexion
     *
     */
    public static Connection getInstance() {
        if (connect == null) {
            try {
                connect = DriverManager.getConnection(url, user, passwd);
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        return connect;
    }

    public static String formatTable(String table) {
        return "\"" + user.toUpperCase() + "\".\"" + table + "\"";
    }

    public static String formatCol(String col) {
        return "\""+col+ "\"";
    }
}
